1. Field of the Invention
Embodiments described herein are directed to adjustable load-sharing circular queues. Specifically, the size of the circular queues is changed dynamically, without any copying or moving of queue data.
2. Related Art
Simple circular queues form a common method of buffering data. A circular queue consists of an input pointer and an output pointer that are incremented each time a data element is processed, in a first-in/first-out (xe2x80x9cFIFOxe2x80x9d) manner. Upon reaching the end of a queue, the pointers wrap around to the beginning again. While last-in/first-out (xe2x80x9cLIFOxe2x80x9d) processing of data elements is possible, such processing is normally referred to as a stack rather than a circular queue.
Since circular queues do not require maintenance of linked lists or memory allocation because of their fixed sizes, they are especially useful in time sensitive applications. A disadvantage of circular queues is that they are not memory efficient, in that the space allocated to the queues is not dynamically changeable.
In digital network communications, a circular queue is often used in buffering incoming and outgoing high-speed data. In many instances, redundancy is a requirement such that a second queue is used to buffer a secondary data stream, either as a backup or in a load-sharing configuration. Oftentimes, a large space is needed for these queues, since high-speed network traffic frequently occurs in bursts.
Space allocated for these queues to be dynamically balanced based on the amount of traffic at each queue point would thus prove helpful. Such allocation of space reduces significantly the amount of needed memory. That is, as a result of a backup or load-sharing configuration, total traffic at the two queues will not exceed the amount of traffic incurred if only one queue were used.
U.S. Pat. No. 6,145,061, issued Nov. 7, 2000, and entitled xe2x80x9cMethod of Management of a Circular Queue for Asynchronous Accessxe2x80x9d discloses the use of a marker within queue data so as to allow sharing of circular queues by multiple processing threads as well as changing of queue size. This method adds to the operations needed in the queue input/output functions and thus affects their performance. Moreover, when queue sizes change, data copying becomes required.
A method of reversing the processing order of a second queue placed adjacent to a first queue to allow the space allocated to both queues to be dynamically adjusted, without copying or moving queue data or affecting the performance of the input/output queue functions is thus a well-needed improvement over current methods.